//: Playground - noun: a place where people can play

import UIKit

var str = "Hello, playground"

var array = ["A","B","C"]

var array2:[String] = ["A","B","C"]

var array3:Array <String> = ["A","B","C"]

array[0] = "AA"
array


var array4 = [Int]()
var array5 = Array<String>()
var array6:Array<Int> = []
array6.append(5)
array=[]

//array.append(2)
array.append("AA")

//array=[String]()



var array7:[Int] = [Int](count: 10, repeatedValue: 0)




array.count
array.isEmpty
array.append("BB")
array += ["CC"]

array.insert("DD", atIndex: 3)

array.removeAtIndex(0)
array.removeLast()

array[0] = "AA"
array = ["A","B","C"]
array[1...2] = ["bb","cc"]
array

//for index in
//    0..< array.count
//{
//    print(array[index])
//}

//for item in array
//{
//    print(item)
//}

//for (index, item) in EnumerateGenerator(array)
//{
//    print("\(index) - \(item) ")
//}


var courses =  [1:"a",2:"b",3:"c"]
var websites = ["a": "aa" , "b":"bb", "c":"cc"]

var courses1:Dictionary <Int,String> = [1:"a",2:"b",3:"c"]
var websites1:Dictionary <String,String> = ["a": "aa" , "b":"bb", "c":"cc"]

var courses2:[Int:String] = [1:"a",2:"b",3:"c"]
var websites2:[String:String] = ["a": "aa" , "b":"bb", "c":"cc"]


var dict = Dictionary<Int,String>()
var dict2 = [Int:String]()


//courses = [:]
//websites = [String:String]()

courses.count
courses.isEmpty
courses[1]

websites["a"]

"haha " + websites["b"]!

courses[4] = "d"
courses.updateValue("dd", forKey: 4)
courses

courses[4] = nil
courses
courses.removeValueForKey(3)

for (key,value) in courses
{
    print("\(key) : \(value)")
}

courses.keys
courses.values

for key in courses.keys
{
    print("\(key)")
}

for value in courses.values
{
    print("\(value)")
}



